package com.albert.service.impl;


import com.albert.entity.User;
import com.albert.mapper.UserMapper;
import com.albert.service.UserService;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<BaseMapper<User>, User> implements UserService{
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getByName(String name) {
        return userMapper.selectByName(name);
    }

    public List<User> getAllUsers() {
        return userMapper.selectAll();
    }
}
